how to check if local storage variable exists in javascript

80

how to check if local storage variable exists in javascript -

if (localStorage.getItem("username") === null) {
  //...
}

Comments

Submit
0 Comments